home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
4dostool
/
rmd200.zip
/
RMD.DOC
< prev
Wrap
Text File
|
1994-02-01
|
20KB
|
535 lines
R M D
Safe Directory Tree Deleter
version 2.00
(C) 1994 Richard Schaaf
RMD V2.00 2 1 Feb 94
TABLE OF CONTENTS
1. Copyright Stuff and Disclaimer........................ 3
2. Introduction.......................................... 3
3. System Requirements................................... 3
4. Installation.......................................... 3
5. Usage................................................. 4
5.1 Syntax.......................................... 4
5.2 Disabling/Enabling Individual Checks............ 4
5.3 Optimization.................................... 5
5.4 Move Up Mode.................................... 5
5.5 Verbosity Levels................................ 6
5.6 Help System..................................... 7
5.7 Environment Variables........................... 7
5.7.1 The NO_RMD variable...................... 7
5.7.2 The RMD_SW variable...................... 7
6. Command Line Parsing.................................. 8
7. Hints/Tips............................................ 8
8. Author................................................ 9
9. Planned Enhancements.................................. 9
10. History...............................................10
RMD V2.00 2 1 Feb 94
RMD V2.00 3 1 Feb 94
1. Copyright Stuff and Disclaimer
=================================
This program is freely distributable provided that all files in
this archive are distributed together. Please keep in mind that the
author is the exclusive copyright holder. You may use this program
as you seem fit but you are not allowed to make modifications to it
without the explicit consent from the author.
The author cannot be held responsible for damage (including lost
files) incurred, either direct or indirect, by using the files in this
archive. The author also does not guarantee the program will work
as indicated in this file although every effort has been made to
make sure it does. If you find an instance where it does not work
as documented, please report it to the author at the address stated
in section 8.
2. Introduction
===============
This command recursively removes directory trees. The idea behind
using RMD and not "alias rmd=del /s/x/z" or "alias rmd=del /s/x/y/z"
is that the former always asks for acknowledgment (leading to an
automatic "Y" answer after some time) and the latter never asks anything
(leading to unintended deletes).
RMD tries to predict whether the directory it is about to delete is
a directory that the user actually wants to delete. If it thinks the
operation is suspect, it will ask the user for confirmation, otherwise
it will just go ahead and delete it.
If you find RMD useful, please send me a postcard at the address in
section 8.
IN ANY CASE, SEND ME EMAIL IF YOU CAN. THAT IS THE ONLY WAY YOU WILL
BE KEPT INFORMED ABOUT UPDATES AND GET SWIFT REPLIES TO BUG REPORTS AND
ENHANCEMENT REQUESTS.
3. System Requirements
======================
A PC running DR/PC/MS-DOS 3.3 or higher and 4DOS5.0c or later.
4. Installation
===============
Start "install.btm". This program will guide you through the installation
process.
Finally, decide where you would like RMD to put its temporary file. RMD
uses the following algoritm for determining where to put its temporary
file:
if 4DOSTEMP is set then use it
else if TEMP is set then use it
else if TMP is set then use it
else use the root directory of the boot drive
end if
RMD V2.00 3 1 Feb 94
RMD V2.00 4 1 Feb 94
5. Usage
========
5.1 Syntax
----------
RMD [del flags] [answer flags] [/o<123>] [/u<012>] [/v[v]] [/c] [/h] [/?] dirs
Where : delete flags = flags that are passed to the "del" command
(all flags that rmd does not recognize are
passed to the del command)
answer flags = assume yes for certain checks (section 5.2)
/o1 /o2 /o3 = optimize directories (section 5.3)
/u0 /u1 /u2 = move up flags (section 5.4)
/v and /vv = verbosity level; will give more information
(section 5.5)
/c = display copyright and version information
/h and /? = starts the on-line help system (section 5.6)
dirs = one or more directories that should be deleted
RMD will warn the user if a directory is suspect, or better:
- if the directory is not on the current drive, and/or
- the directory is the root directory of a drive, and/or
- the directory is "higher" than the current directory, and/or
- the delete would delete a directory in the NO_RMD variable
(section 5.7.1)
(This is only true if the check has not been disabled, see section 5.2)
If a directory is suspect the user will be asked for confirmation.
At that point the user has the following options:
Y = Delete this directory
N = Skip this directory
A = Always delete (don't check for suspect directories)
Q = Quit (don't delete anything)
H = Help
! = Shell out to 4DOS (COMSPEC has to be set for this to work)
An argument is always skipped if:
- the argument is on a drive that is not ready
- the argument does not exist
- the argument exists but is not a directory
- the argument is a directory on a CD-ROM
- the argument is a directory on a network drive (unless overridden with
/y+w:<drives>)
5.2 Disabling/Enabling Individual Checks
----------------------------------------
Individual checks can be disabled or enabled with the "answer flags".
The answer flags disable (/y+) or enable (/y-) individual check for
specific drives. Checks that can be disabled or enabled are:
The different drive check (type=D)
The root directory check (type=R)
The higher directory check (type=H)
The NO_RMD check (type=N)
The network drive check (type=W)
The complete definition of the answer flags is as follows:
RMD V2.00 4 1 Feb 94
RMD V2.00 5 1 Feb 94
answer flags = [/y+<type>[:drives]] [/y-<type>[:drives]] [/yes] [/fd]
where /yes = /y+d/y+r/y+h/y+n
/fd = /y+d:AB/y+r:AB
If no drives are specified, the flag applies to all drives.
Example: /y+d/y-d:c disabled the different drive check unless
that other drive is drive C
5.3 Optimization
----------------
There are two kinds of optimization. The first kind (/o1) removes directories
that will be deleted anyway from the list of directories. For example:
"rmd /yes .. ..\q" in "c:\tmp" will be translated to "del /s/x/y/z c:\ c:\q",
but "c:\q" will have been deleted already by the "del /s/x/y/z c:\". If you
specify the "/o1" flag, rmd will execute "del /s/x/y/z c:\"
Note that specifying the "/o1" flag does not only reduce the number of
parameters to the "del" command but also prevents some accidental deletes.
Assume there is a file "c:\test\q. Consider "rmd q q" in "c:\". This will
be translated to "del /s/x/y/z q q". The first "q" will delete the directory
"c:\q", as expected and as probably intended. The second "q", however, will
remove all files named "q" on drive C, including "c:\test\q" !!!
Now consider "rmd /o1 q q". In this case, RMD will notice that the intended
delete is "del /s/x/y/z q" and not "del /